/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.longph.btvn2;

/**
 *
 * @author Long
 */
public class ThuVien {

    static int chuyencoso(int b, int a[], int n) {
        int i = 1;
        while (n > 0) {
            a[i] = n % b;
            n = n / b;
            i++;
        }
        return i;
    }
    public static boolean ngto(long n) {
        if (n<2) {
            return false;
        }
        int k = (int) Math.sqrt(n);
        for (int i = 2; i <= k; i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }
}
